<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWorshipCollectionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('worship_collections', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->string('name', 50)->nullable()->comment('名称');
            $table->text('worship_hymns')->nullable()->comment('赞美诗');
            $table->string('description')->nullable()->comment('描述');
            $table->string('pic_url')->nullable()->comment('封面');
            $table->integer('play_count')->nullable()->default(0)->comment('播放数');
            $table->integer('hymn_count')->nullable()->default(0)->comment('记录数');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('worship_collections');
    }
}
